﻿package com._public._utils._mailer
{
	import flash.utils.ByteArray;
	
	
	/**
	 * 邮件附件
	 * 
	 * @author laan
	 * @createTime 200908
	 * 
	 */	
	public class Attachment
	{
		private var fileName:String;
		private var fileBytes:ByteArray;
		private var _contentId:String;
		
		public function Attachment(file:String, bytes:ByteArray, id:String = null) {
			fileName = file;
			fileBytes = bytes;
			
			_contentId = id;
		}
		
		public function get name():String {
			return fileName;
		}
		
		public function get data():String {
			return Base64.encodeByteArray(fileBytes);
			
		}
		
		public function get contentId():String {
			return _contentId;
		}
		
		public function isInline():Boolean {
			return _contentId != null
		}
		
		public function get bytes():ByteArray {
			return fileBytes;
		}

	}
}